package com.jonniespratley.generators.php
{
	import com.jonniespratley.generators.templates.TemplateEvent;
	import com.jonniespratley.generators.templates.TemplateManager;

	public class PHPGen implements IPHP
	{
		static public const PHP_VO_TEMPLATE:String = 'com/jonniespratley/generators/templates/php/vo.txt';
		static public const PHP_DAO_TEMPLATE:String = 'com/jonniespratley/generators/templates/php/dao.txt';

		public function PHPGen()
		{
		}

		public function generateVO(table:String, fields:Array):String
		{
			var out:String;
			var template:TemplateManager = new TemplateManager();
				template.loadTemplate('com/jonniespratley/generators/templates/php/vo.txt');

				template.addEventListener( TemplateEvent.TEMPLATE_LOAD_SUCCESS, function( event:TemplateEvent ):void{
					out = event.templateData;
				});
				for( var s:String in fields )
				{
					out += fields[s];
				}
			return out;
		}

		public function generateDAO(table:String, fields:Array):String
		{
			var out:String = '';


			return out;
		}

	}
}